package net.vanchu.mortgagecalculator.mortgage.data.monthRepayment;

/**
 * Created by Granton on 2016/12/22.
 */
public class SingleMonthRepay extends MonthRepay {

    private double principal;

    private double interest;

    public SingleMonthRepay(int index, double remainPrincipal, double principal, double interest) {
        super(index, remainPrincipal);
        this.principal = principal;
        this.interest = interest;
    }

    @Override
    public double getTotalPrincipal() {
        return principal;
    }

    @Override
    public double getTotalInterest() {
        return interest;
    }

    @Override
    public double getTotalRepayNumber() {
        return principal + interest;
    }

    public boolean isLastMonth(int numberOfMonths) {
        return index == numberOfMonths;
    }

}